Do not set valueDeclaration for intersection properties when one symbol does not have a valueDeclaration#61872
Do not set valueDeclaration for intersection properties when one symbol does not have a valueDeclaration#61872mdm317 wants to merge 2 commits intomicrosoft:mainfrom
valueDeclaration for intersection properties when one symbol does not have a valueDeclaration#61872Conversation
src/compiler/checker.ts
Outdated
| let hasNonUniformValueDeclaration = false; | ||
| for (const prop of props) { | ||
| if (!firstValueDeclaration) { | ||
| if(!prop.valueDeclaration){ |
There was a problem hiding this comment.
In isConflictingPrivateProperty, if symbols are not uniform and has private properties, determine property is conflict
function isConflictingPrivateProperty(prop: Symbol) {
// Return true for a synthetic property with multiple declarations, at least one of which is private.
return !prop.valueDeclaration && !!(getCheckFlags(prop) & CheckFlags.ContainsPrivate);
}
Currently, a intersection/uniform property is treated as uniform when one source property has a valueDeclaration, while another source property(mapped type) does not.
I think we should treat such properties as non-uniform instead.
|
@microsoft-github-policy-service agree |
|
@typescript-bot test it |
|
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
|
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Fixes #61743
This issue arised because the intersection types are different.